import pandas as pd
from selenium.webdriver.common.by import By

from config import BASE_DIR


def Read_xlsx(name):
    # 读取Excel文件
    excel_file_path = f'{BASE_DIR}/data/{name}.xlsx'
    df = pd.read_excel(excel_file_path)

    # 将DataFrame中的数据转换成列表
    data_list = df.values.tolist()
    # 操作方法
    find_type = []
    # find_type = [i[0] for i in data_list]
    # find_type = list(map(lambda x: x[0], data_list))
    # find_type = [item[0] for item in data_list]

    # 定位方法（XPATH,ID,LINK）
    find_method = []
    # 定位的位置
    find_location = []
    # 定位输入内容
    find_input = []
    # 断言
    find_assert = []

    for i in data_list:
        find_type.append(i[0])
        find_method.append(i[1])
        find_location.append(i[2])
        find_input.append(i[3])
        find_assert.append(i[4])

    return find_type, find_method, find_location, find_input, find_assert
if __name__ == '__main__':
    Read_xlsx("test")